package com.shinlooker.hencoder.utils;

import android.util.Base64;

/**
 * @ClassName Base64Util
 * @Description java类作用描述
 * @Author Hank
 * @CreateDate 2020/5/12 13:42
 * @UpdateUser Hank
 * @UpdateDate 2020/5/12 13:42
 * @UpdateRemark 更新说明：
 * @Version 1.0
 */
public class Base64Util {

    public static String encode(String content) {
        byte[] b = DataConvertUtil.hexStringToBytes(content);
        return new String(Base64.encode(b, Base64.URL_SAFE | Base64.NO_WRAP));
//        return Base64.encodeToString(b, Base64.URL_SAFE | Base64.NO_WRAP)
    }

    public static String decode(String encodedString) {
        return new String(Base64.decode(encodedString, Base64.URL_SAFE));
    }
}
